**** Replication Data for 'Seeing Spanish' ****
**** Darr, Dunaway, Perry, Sui ********
**** Political Communication ***

set more off

****************************************
****** ANALYSES: EL, whites only *******
********* Figure 3 & Table A1 **********
****************************************
cd "*** SET YOUR WORKING DIRECTORY HERE ***"

use "MTurk SL media analysis no id.dta", clear

**** Whites only ****
keep if ethnicity==1

** Variable labels **
label define sl_pol_any 0 "English" 1 "Spanish"
label variable sl_pol_any "Language of political article option"
label values sl_pol_any sl_pol_any

label define sl_sports 0 "English" 1 "Spanish"
label variable sl_sports "Language of sports article option"
label values sl_sports sl_sports

** Politics article in Spanish vs. all articles in English: **
** Hispanic racial resentment index: 7.4 % higher, p < 0.1 **
reg hisp_rrindex sl_politics
outreg2 using "Tables/Table A1 - Experimental analyses.doc", se dec(3)


** Sports article in Spanish vs. all articles in English: n.s. **
reg hisp_rrindex sl_sports
outreg2 using "Tables/Table A1 - Experimental analyses.doc", se dec(3)
margins, by(sl_sports)
marginsplot, recast(scatter) xscale(range(-0.5 1.5)) ylabel(0.3(0.1)0.7) yscale(range(0.3 0.7)) title("All articles in English" "vs. sports article in Spanish") ytitle("Predicted racial resentment" "towards Hispanics (0-1)")/*
	*/ graphregion(color(white)) plotregion(color(white)) bgcolor(white) graphregion(margin(small)) scheme(s1mono)

graph save "Figures/White_Sports_HispRR.gph", replace
graph export "Figures/White_Sports_HispRR.png", replace


** sl_pol_any: (T1 + T3) vs. (T2 + T4) [p < 0.05] **
reg hisp_rrindex sl_pol_any
outreg2 using "Tables/Table A1 - Experimental analyses.doc", se dec(3)
margins, by(sl_pol_any)
marginsplot, recast(scatter) xscale(range(-0.5 1.5)) ylabel(0.3(0.1)0.7) yscale(range(0.3 0.7)) title("Politics article in English" "vs. politics article in Spanish") ytitle("Predicted racial resentment" "towards Hispanics (0-1)")/*
	*/ graphregion(color(white)) plotregion(color(white)) bgcolor(white) graphregion(margin(small)) scheme(s1mono)

graph save "Figures/White_HispRR.gph", replace
graph export "Figures/White_HispRR.png", replace



*** Create table ***
eststo: reg hisp_rrindex sl_politics

eststo: reg hisp_rrindex sl_sports

eststo: reg hisp_rrindex sl_pol_any



*****************************************************
****** ANALYSES: SL, Spanish-speaking Latinos *******
********* Figure 5 & Table A1 ***********************
*****************************************************
use "Qualtrics SL media analysis no id.dta", clear

label define sl_pol_any 0 "English" 1 "Spanish"
label variable sl_pol_any "Language of political article option"
label values sl_pol_any sl_pol_any

label define sl_sports 0 "English" 1 "Spanish"
label variable sl_sports "Language of sports article option"
label values sl_sports sl_sports



** "I feel like I belong in the United States" (p < 0.05) **
reg belonging_1 sl_politics
outreg2 using "Tables/Table A1 - Experimental analyses.doc", se dec(3)
eststo: reg belonging_1 sl_politics

eststo: reg belonging_1 sl_sports

reg belonging_1 sl_sports
outreg2 using "Tables/Table A1 - Experimental analyses.doc", se dec(3)
margins, by(sl_sports)
marginsplot, recast(scatter) xscale(range(-0.5 1.5)) ylabel(0.3(0.1)0.7) yscale(range(0.3 0.7)) title("All articles in English" "vs. sports article in Spanish") ytitle("Predicted sense of" "belonging in the U.S. (0-1)") /*
	*/ graphregion(color(white)) plotregion(color(white)) bgcolor(white) graphregion(margin(small)) scheme(s1mono)
graph save "Figures/SL_Sports_Belonging.gph", replace
graph export "Figures/SL_Sports_Belonging.png", replace



** sl_pol_any: (T1 + T3) vs. (T2 + T4) [p < 0.05] **
reg belonging_1 sl_pol_any
outreg2 using "Tables/Table A1 - Experimental analyses.doc", se dec(3)

margins, by(sl_pol_any)
marginsplot, recast(scatter) xscale(range(-0.5 1.5)) ylabel(0.3(0.1)0.7) yscale(range(0.3 0.7)) title("Politics article in English" "vs. politics article in Spanish") ytitle("Predicted sense of" "belonging in the U.S. (0-1)") /*
	*/ graphregion(color(white)) plotregion(color(white)) bgcolor(white) graphregion(margin(small)) scheme(s1mono)

graph save "Figures/SL_Belonging.gph", replace
graph export "Figures/SL_Belonging.png", replace

eststo: reg belonging_1 sl_pol_any

** "Most Americans value and respect my individual presence in the United States" (p < 0.1) **
reg belonging_2 sl_pol_any
outreg2 using "Tables/Table A1 - Experimental analyses.doc", se dec(3)

*esttab using "Figures/HispRRindex.tex", b(3) se(3)





***********************************************************
****** FIGURE 3: Whites & FIGURE 5: Spanish-speakers ******
***********************************************************

graph combine "Figures/White_Sports_HispRR.gph" "Figures/White_HispRR.gph", row(1) ysize(3) graphregion(color(white)) title("Study 1: Racial resentment, White respondents", size(medlarge))
graph save "Figures/Figure 3 - Whites sports v politics.gph", replace
graph export "Figures/Figure 3 - Whites sports v politics.png", replace

graph combine "Figures/SL_Sports_Belonging.gph" "Figures/SL_Belonging.gph", row(1) ysize(3) title("Study 2: Sense of belonging, Spanish-speaking respondents", size(medlarge)) graphregion(color(white))
graph save "Figures/Figure 5 - Spanish speaker sports v. politics.gph", replace
graph export "Figures/Figure 5 - Spanish speaker sports v. politics.png", replace





****************************************************
****** FIGURE 4: EL, whites only, with party *******
****************************************************

use "MTurk SL media analysis no id.dta", clear

**** Whites only ****
keep if ethnicity==1


label define sl_pol_any 0 "English" 1 "Spanish"
label variable sl_pol_any "Language of political article option"
label values sl_pol_any sl_pol_any


reg hisp_rrindex i.sl_pol_any if democrat==1
outreg2 using "Tables/Table A2 - Whites by party.doc", se dec(3)

margins, by(sl_pol_any)
marginsplot, recast(scatter) xscale(range(-0.5 1.5)) ylabel(0(0.1)1) yscale(range(0 1)) title("Democrats") ytitle("Predicted racial resentment" "towards Hispanics (0-1)")/*
	*/ graphregion(color(white)) plotregion(color(white)) bgcolor(white) scheme(s1mono)	
pwcompare sl_pol_any, effects

graph save "Figures/White_HispRR_Dem.gph", replace
graph export "Figures/White_HispRR_Dem.png", replace


reg hisp_rrindex i.sl_pol_any if republican==1
outreg2 using "Tables/Table A2 - Whites by party.doc", se dec(3)

margins, by(sl_pol_any)
marginsplot, recast(scatter) xscale(range(-0.5 1.5)) ylabel(0(0.1)1) yscale(range(0 1)) title("Republicans") ytitle("Predicted racial resentment" "towards Hispanics (0-1)")/*
	*/ graphregion(color(white)) plotregion(color(white)) bgcolor(white) scheme(s1mono)	
pwcompare sl_pol_any, effects
	
graph save "Figures/White_HispRR_Rep.gph", replace
graph export "Figures/White_HispRR_Rep.png", replace


graph combine "Figures/White_HispRR_Dem.gph" "Figures/White_HispRR_Rep.gph", row(1) col(2) ysize(3) title("") graphregion(color(white))
graph save "Figures/Figure4.gph", replace
graph export "Figures/Figure 4 - Whites only by party.png", replace








***************************
** Supplemental Appendix **
***************************


************************************************
**** Figure A1: Student sample replication *****
************************************************
use "MEL SL experiment cleaned no id.dta", clear

label define sl_politics 0 "English" 1 "Spanish"
label variable sl_politics "Language of politics article option"
label values sl_politics sl_politics

label define sl_pol_any 0 "English" 1 "Spanish"
label variable sl_pol_any "Language of politics article option"
label values sl_pol_any sl_pol_any

label define sl_sports 0 "English" 1 "Spanish"
label variable sl_sports "Language of sports article option"
label values sl_sports sl_sports


reg hisp_rrindex sl_sports
outreg2 using "Tables/Table A5 - MEL analyses.doc", se dec(3)
margins, by(sl_sports)
marginsplot, recast(scatter) xscale(range(-0.5 1.5)) ylabel(0.3(0.1)0.7) yscale(range(0.3 0.7)) title("Spanish-language sports article vs." "All English-language articles") ytitle("Hispanic racial resentment index") /*
	*/ graphregion(color(white)) plotregion(color(white)) bgcolor(white) graphregion(margin(small)) scheme(s1mono)

graph save "Figures/SL_MEL_sports.gph", replace
graph export "Figures/SL_MEL_sports.png", replace

reg hisp_rrindex sl_pol_any
outreg2 using "Tables/Table A5 - MEL analyses.doc", se dec(3)
margins, by(sl_pol_any)
marginsplot, recast(scatter) xscale(range(-0.5 1.5)) ylabel(0.3(0.1)0.7) yscale(range(0.3 0.7)) title("Spanish-language politics article vs." "English-language politics article") ytitle("Hispanic racial resentment index") /*
	*/ graphregion(color(white)) plotregion(color(white)) bgcolor(white) graphregion(margin(small)) scheme(s1mono)

graph save "Figures/SL_MEL_pol_any.gph", replace
graph export "Figures/SL_MEL_pol_any.png", replace


*** Combined figures ***
graph combine "Figures/SL_MEL_sports.gph" "Figures/SL_MEL_pol_any.gph", row(2) cols(1) xsize(2.5) graphregion(color(white)) title("Student Sample")
graph save "Tables/Figure A2 - MEL replication.gph", replace
graph export "Tables/Figure A2 - MEL replication.png", replace



***************************************************
**** Table A4, Figure A2: Language Proficiency ****
***************************************************
use "Qualtrics SL media analysis no id.dta", clear

label define sl_politics 0 "English" 1 "Spanish"
label variable sl_politics "Language of politics article option"
label values sl_politics sl_politics

label define sl_pol_any 0 "English" 1 "Spanish"
label variable sl_pol_any "Language of politics article option"
label values sl_pol_any sl_pol_any

label define sl_sports 0 "English" 1 "Spanish"
label variable sl_sports "Language of sports article option"
label values sl_sports sl_sports

replace eng_prof =. if eng_prof==5

gen eng_fluent = 1 if eng_prof==4
replace eng_fluent = 0 if eng_prof==1 | eng_prof==2 | eng_prof==3


** Proficient in English **
reg belonging_1 sl_pol_any if eng_fluent==1
outreg2 using "Tables/Table A4 - English proficiency.doc", se dec(3)
margins, by(sl_pol_any)
marginsplot, recast(scatter) xscale(range(-0.5 1.5)) ylabel(0.3(0.1)0.7) yscale(range(0.3 0.7)) title("Fluent in English") ytitle("Sense of belonging in the U.S.")/*
	*/ graphregion(color(white)) plotregion(color(white)) bgcolor(white) graphregion(margin(medium)) scheme(s1mono)

graph save "Figures/SL_Belonging_English.gph", replace
graph export "Figures/SL_Belonging_English.png", replace

** Those who only know some English **
reg belonging_1 sl_pol_any if eng_fluent==0
outreg2 using "Tables/Table A4 - English proficiency.doc", se dec(3)
margins, by(sl_pol_any)
marginsplot, recast(scatter) xscale(range(-0.5 1.5)) ylabel(0.3(0.1)0.7) yscale(range(0.3 0.7)) title("Not fluent in English") ytitle("Sense of belonging in the U.S.")/*
	*/ graphregion(color(white)) plotregion(color(white)) bgcolor(white) graphregion(margin(medium)) scheme(s1mono)

graph save "Figures/SL_Belonging_English_notfluent.gph", replace
graph export "Figures/SL_Belonging_English_notfluent.png", replace


graph combine "Figures/SL_Belonging_English.gph" "Figures/SL_Belonging_English_notfluent.gph", xsize(6) ysize(3) graphregion(color(white)) graphregion(margin(vsmall)) title("Spanish-speaking respondents [Qualtrics]", size(medium))

graph save "Figures/Figure A2 - English proficiency.gph", replace
graph export "Figures/Figure A2 - English proficiency.png", replace




***********************************************
******* Table A5: SL Racial Attitudes *********
***********************************************
reg hisp_rrindex i.sl_pol_any
outreg2 using "Tables/Table A5 - Racial attitudes.doc", se dec(3)

reg lazy_hisp i.sl_pol_any
outreg2 using "Tables/Table A5 - Racial attitudes.doc", se dec(3)
reg lazy_white i.sl_pol_any
outreg2 using "Tables/Table A5 - Racial attitudes.doc", se dec(3)
reg lazy_black i.sl_pol_any
outreg2 using "Tables/Table A5 - Racial attitudes.doc", se dec(3)


reg criminal_hisp i.sl_pol_any
outreg2 using "Tables/Table A5 - Racial attitudes.doc", se dec(3)
reg criminal_white i.sl_pol_any
outreg2 using "Tables/Table A5 - Racial attitudes.doc", se dec(3)
reg criminal_black i.sl_pol_any
outreg2 using "Tables/Table A5 - Racial attitudes.doc", se dec(3)






********************************
*** Table A6 - NAES analyses ***
********************************


*** NOTE: County and media market data is only obtainable through an IRB request from the Annenberg School at the University of Pennsylvania. ***
*** Interested parties should request this data and merge it with this dataset if they wish to include the county-level clustered standard errors, as below. ***

set more off

use "2004 NAES replication without restricted access (fips).dta", clear

keep if ind_white == 1
keep if ind_hispanic == 0
keep if sl_interview == 0

*** Label variables ***
label define watches_tvnews 0 "Does not watch TV news" 1 "Watches TV news"
label variable watches_tvnews "Watches TV news"
label values watches_tvnews watches_tvnews


**** Restrict immigration (+ = more restricted) ****
reg imm_restrict sl_media_2004_dum##watches_tvnews readspaper providers log_hhinc pc_hispanic2004 pc_nhwhite2004 educ_bin female faminc_bin b4.pid7 union_hh follow_politics popdens00 foreignborn_pct i.state, cluster(fips)
** NOTE: Will not match Appendix table if restricted-access county data is not obtained **
*outreg2 using "Tables/Table A6 - NAES analyses.doc", se dec(3) drop(i.state)
test 1.sl_media_2004_dum#0.watches_tvnews = 1.sl_media_2004_dum#1.watches_tvnews


